<?php
$_->extend('admin-layout');

switch ($action) {
    case 'edit':
        $title = _s('Edit "%s"', $post->getTitle());
        break;
    case 'new':
        $title = _s('New post');
        break;
    default:
        throw new RuntimeException('What action is it, edit or new ?');
}
$_->set('title', $title);

$_->add('scripts', 'tinymce');
?>
<form method="post">
    <?php // This is not CSRF-proof :( ?>
    <?php foreach ($form->fields() as $field):
        $field->label();
        $field->help();
        $field->error();
        $field->widget($post, 'titleField');
    endforeach; ?>
    <button type="submit" name="action" value="save"><?php _e('Save post') ?></button>
    <button type="submit" name="action" value="preview"><?php _e('Preview') ?></button>
</form>
<script type="text/javascript">
    var titleField = document.getElementById("titleField");
    var slugField = document.getElementById("slugField");
    
    
</script>
    